class reload{
    constructor(){
        this.init();
    }
}
$.extend(reload.prototype,{
    init:function(){
        if($.cookie('username')){
            this.reload();
        }
        $('.header-top-left-fifth').on('click',$.proxy(this.logout,this))

    },
    reload:function(){
        $('.header-top-left-forth').css({display:'block'});
        $('.header-top-left-fifth').css({display:'block'});
        $('.header-top-left-sixty').css({display:'block'});
        $('.header-top-left-second').css({display:'none'});
        $('.header-top-left-third').css({display:'none'});
        $('.header-top-left-forth').text('欢迎'+$.cookie('username')+'光临');
    },
    logout:function(){
        $.cookie('username','',{ expires: -1,path:'/flower/dist' });
        $('.header-top-left-forth').css({display:'none'});
        $('.header-top-left-fifth').css({display:'none'});
        $('.header-top-left-sixty').css({display:'none'});
        $('.header-top-left-second').css({display:'block'});
        $('.header-top-left-third').css({display:'block'});
    }

})

export default reload;